﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_CB_CHAOBIAOSJ实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_CB_CHAOBIAOSJ
    {
        private decimal? m_dec_i_benyuecm;

        private decimal? m_dec_i_benyuesl;

        private decimal? m_dec_i_ceng;

        private decimal? m_dec_i_chaobiaozt;

        private decimal? m_dec_i_jihuasl;

        private decimal? m_dec_i_jihuasldl;

        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_m;

        private decimal? m_dec_i_shuiliangdl;

        private decimal? m_dec_i_y;

        private decimal m_dec_id;

        private decimal? m_dec_n_bilv;

        private decimal? m_dec_n_shuijia;

        private DateTime? m_DT_d_caozuorq;

        private DateTime? m_DT_d_tianjiarq;

        private string m_str_s_bumenbh;

        private string m_str_s_caozuor;

        private string m_str_s_cehao;

        private string m_str_s_hangyebh;

        private string m_str_s_huanxianbj;

        private string m_str_s_jingbh;

        private string m_str_s_jingbiaosbh;

        private string m_str_s_jingleixbh;

        private string m_str_s_jingzhuangtbh;

        private string m_str_s_liuyubh;

        private string m_str_s_qushuiytbh;

        private string m_str_s_shuibiaobh;

        private string m_str_s_shuilianglb;

        private string m_str_s_tianjiar;

        private string m_str_s_xingzhengqbh;

        private string m_str_s_xukezbh;

        private string m_str_s_yonghuh;

        private string m_str_s_yongtu;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     水表编号
        /// </summary>
        public string S_SHUIBIAOBH
        {
            get { return m_str_s_shuibiaobh; }
            set { m_str_s_shuibiaobh = value; }
        }

        /// <summary>
        ///     抄表状态
        /// </summary>
        public decimal? I_CHAOBIAOZT
        {
            get { return m_dec_i_chaobiaozt; }
            set { m_dec_i_chaobiaozt = value; }
        }

        /// <summary>
        ///     水量年
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     水量月
        /// </summary>
        public decimal? I_M
        {
            get { return m_dec_i_m; }
            set { m_dec_i_m = value; }
        }

        /// <summary>
        ///     本月抄码
        /// </summary>
        public decimal? I_BENYUECM
        {
            get { return m_dec_i_benyuecm; }
            set { m_dec_i_benyuecm = value; }
        }

        /// <summary>
        ///     本月水量
        /// </summary>
        public decimal? I_BENYUESL
        {
            get { return m_dec_i_benyuesl; }
            set { m_dec_i_benyuesl = value; }
        }

        /// <summary>
        ///     计划水量
        /// </summary>
        public decimal? I_JIHUASL
        {
            get { return m_dec_i_jihuasl; }
            set { m_dec_i_jihuasl = value; }
        }

        /// <summary>
        ///     比率
        /// </summary>
        public decimal? N_BILV
        {
            get { return m_dec_n_bilv; }
            set { m_dec_n_bilv = value; }
        }

        /// <summary>
        ///     记录状态
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     井编号
        /// </summary>
        public string S_JINGBH
        {
            get { return m_str_s_jingbh; }
            set { m_str_s_jingbh = value; }
        }

        /// <summary>
        ///     部门编号
        /// </summary>
        public string S_BUMENBH
        {
            get { return m_str_s_bumenbh; }
            set { m_str_s_bumenbh = value; }
        }

        /// <summary>
        ///     取水用途编号
        /// </summary>
        public string S_QUSHUIYTBH
        {
            get { return m_str_s_qushuiytbh; }
            set { m_str_s_qushuiytbh = value; }
        }

        /// <summary>
        ///     行业编号
        /// </summary>
        public string S_HANGYEBH
        {
            get { return m_str_s_hangyebh; }
            set { m_str_s_hangyebh = value; }
        }

        /// <summary>
        ///     行政区编号
        /// </summary>
        public string S_XINGZHENGQBH
        {
            get { return m_str_s_xingzhengqbh; }
            set { m_str_s_xingzhengqbh = value; }
        }

        /// <summary>
        ///     流域编号
        /// </summary>
        public string S_LIUYUBH
        {
            get { return m_str_s_liuyubh; }
            set { m_str_s_liuyubh = value; }
        }

        /// <summary>
        ///     环线标记
        /// </summary>
        public string S_HUANXIANBJ
        {
            get { return m_str_s_huanxianbj; }
            set { m_str_s_huanxianbj = value; }
        }

        /// <summary>
        ///     层
        /// </summary>
        public decimal? I_CENG
        {
            get { return m_dec_i_ceng; }
            set { m_dec_i_ceng = value; }
        }

        /// <summary>
        ///     许可证
        /// </summary>
        public string S_XUKEZBH
        {
            get { return m_str_s_xukezbh; }
            set { m_str_s_xukezbh = value; }
        }

        /// <summary>
        ///     井类型编号
        /// </summary>
        public string S_JINGLEIXBH
        {
            get { return m_str_s_jingleixbh; }
            set { m_str_s_jingleixbh = value; }
        }

        /// <summary>
        ///     井标识编号
        /// </summary>
        public string S_JINGBIAOSBH
        {
            get { return m_str_s_jingbiaosbh; }
            set { m_str_s_jingbiaosbh = value; }
        }

        /// <summary>
        ///     井状态编号
        /// </summary>
        public string S_JINGZHUANGTBH
        {
            get { return m_str_s_jingzhuangtbh; }
            set { m_str_s_jingzhuangtbh = value; }
        }

        /// <summary>
        ///     册号
        /// </summary>
        public string S_CEHAO
        {
            get { return m_str_s_cehao; }
            set { m_str_s_cehao = value; }
        }

        /// <summary>
        ///     水量类别
        /// </summary>
        public string S_SHUILIANGLB
        {
            get { return m_str_s_shuilianglb; }
            set { m_str_s_shuilianglb = value; }
        }

        /// <summary>
        ///     添加人
        /// </summary>
        public string S_TIANJIAR
        {
            get { return m_str_s_tianjiar; }
            set { m_str_s_tianjiar = value; }
        }

        /// <summary>
        ///     添加日期
        /// </summary>
        public DateTime? D_TIANJIARQ
        {
            get { return m_DT_d_tianjiarq; }
            set { m_DT_d_tianjiarq = value; }
        }

        /// <summary>
        ///     修改人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     修改日期
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }

        /// <summary>
        ///     用途
        /// </summary>
        public string S_YONGTU
        {
            get { return m_str_s_yongtu; }
            set { m_str_s_yongtu = value; }
        }

        /// <summary>
        ///     水价
        /// </summary>
        public decimal? N_SHUIJIA
        {
            get { return m_dec_n_shuijia; }
            set { m_dec_n_shuijia = value; }
        }

        /// <summary>
        ///     dcWaterAmountDL
        /// </summary>
        public decimal? I_SHUILIANGDL
        {
            get { return m_dec_i_shuiliangdl; }
            set { m_dec_i_shuiliangdl = value; }
        }

        /// <summary>
        ///     dcMakeAccAmountDL
        /// </summary>
        public decimal? I_JIHUASLDL
        {
            get { return m_dec_i_jihuasldl; }
            set { m_dec_i_jihuasldl = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_CB_CHAOBIAOSJProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_CB_CHAOBIAOSJProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ实体添加或者修改QS_CB_CHAOBIAOSJ信息
        /// </summary>
        public bool InsertOrUpdate(QS_CB_CHAOBIAOSJ QS_CB_CHAOBIAOSJ, OracleTransaction Transaction)
        {
            if (QS_CB_CHAOBIAOSJ.ID == 0)
                InsertQS_CB_CHAOBIAOSJ(QS_CB_CHAOBIAOSJ, Transaction);
            else
                UpdateQS_CB_CHAOBIAOSJ(QS_CB_CHAOBIAOSJ, Transaction);
            return QS_CB_CHAOBIAOSJ.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ实体添加或修改QS_CB_CHAOBIAOSJ信息
        /// </summary>
        public bool InsertOrUpdate(QS_CB_CHAOBIAOSJ QS_CB_CHAOBIAOSJ)
        {
            return InsertOrUpdate(QS_CB_CHAOBIAOSJ, null);
        }


        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ主键删除QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_CB_CHAOBIAOSJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_CB_CHAOBIAOSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ主键删除QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_CB_CHAOBIAOSJ(decimal ID)
        {
            return DeleteQS_CB_CHAOBIAOSJ(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_CB_CHAOBIAOSJsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_CB_CHAOBIAOSJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_CB_CHAOBIAOSJsDynamic(string WhereClause)
        {
            return DeleteQS_CB_CHAOBIAOSJsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ主键选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public QS_CB_CHAOBIAOSJ SelectQS_CB_CHAOBIAOSJ(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_CB_CHAOBIAOSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_CB_CHAOBIAOSJ = PopulateQS_CB_CHAOBIAOSJ(rd);
                rd.Close();
                return QS_CB_CHAOBIAOSJ;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_CB_CHAOBIAOSJ主键选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public QS_CB_CHAOBIAOSJ SelectQS_CB_CHAOBIAOSJ(decimal ID)
        {
            return SelectQS_CB_CHAOBIAOSJ(ID, null);
        }

        /// <summary>
        ///     选择所有QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_CB_CHAOBIAOSJsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <returns>所有QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsAll()
        {
            return SelectQS_CB_CHAOBIAOSJsAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_CB_CHAOBIAOSJsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_CB_CHAOBIAOSJsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_CB_CHAOBIAOSJsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_CB_CHAOBIAOSJ信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_CB_CHAOBIAOSJ信息</returns>
        public DataTable SelectQS_CB_CHAOBIAOSJsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_CB_CHAOBIAOSJsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_CB_CHAOBIAOSJ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_CB_CHAOBIAOSJsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_CB_CHAOBIAOSJDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_CB_CHAOBIAOSJ字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_CB_CHAOBIAOSJsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_CB_CHAOBIAOSJsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_CB_CHAOBIAOSJ(QS_CB_CHAOBIAOSJ QS_CB_CHAOBIAOSJ, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_CB_CHAOBIAOSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_CB_CHAOBIAOSJ.S_SHUIBIAOBH;
            storedParams[1].Value = QS_CB_CHAOBIAOSJ.I_CHAOBIAOZT;
            storedParams[2].Value = QS_CB_CHAOBIAOSJ.I_Y;
            storedParams[3].Value = QS_CB_CHAOBIAOSJ.I_M;
            storedParams[4].Value = QS_CB_CHAOBIAOSJ.I_BENYUECM;
            storedParams[5].Value = QS_CB_CHAOBIAOSJ.I_BENYUESL;
            storedParams[6].Value = QS_CB_CHAOBIAOSJ.I_JIHUASL;
            storedParams[7].Value = QS_CB_CHAOBIAOSJ.N_BILV;
            storedParams[8].Value = QS_CB_CHAOBIAOSJ.I_JLZT;
            storedParams[9].Value = QS_CB_CHAOBIAOSJ.S_YONGHUH;
            storedParams[10].Value = QS_CB_CHAOBIAOSJ.S_JINGBH;
            storedParams[11].Value = QS_CB_CHAOBIAOSJ.S_BUMENBH;
            storedParams[12].Value = QS_CB_CHAOBIAOSJ.S_QUSHUIYTBH;
            storedParams[13].Value = QS_CB_CHAOBIAOSJ.S_HANGYEBH;
            storedParams[14].Value = QS_CB_CHAOBIAOSJ.S_XINGZHENGQBH;
            storedParams[15].Value = QS_CB_CHAOBIAOSJ.S_LIUYUBH;
            storedParams[16].Value = QS_CB_CHAOBIAOSJ.S_HUANXIANBJ;
            storedParams[17].Value = QS_CB_CHAOBIAOSJ.I_CENG;
            storedParams[18].Value = QS_CB_CHAOBIAOSJ.S_XUKEZBH;
            storedParams[19].Value = QS_CB_CHAOBIAOSJ.S_JINGLEIXBH;
            storedParams[20].Value = QS_CB_CHAOBIAOSJ.S_JINGBIAOSBH;
            storedParams[21].Value = QS_CB_CHAOBIAOSJ.S_JINGZHUANGTBH;
            storedParams[22].Value = QS_CB_CHAOBIAOSJ.S_CEHAO;
            storedParams[23].Value = QS_CB_CHAOBIAOSJ.S_SHUILIANGLB;
            storedParams[24].Value = QS_CB_CHAOBIAOSJ.S_TIANJIAR;
            storedParams[25].Value = QS_CB_CHAOBIAOSJ.D_TIANJIARQ;
            storedParams[26].Value = QS_CB_CHAOBIAOSJ.S_CAOZUOR;
            storedParams[27].Value = QS_CB_CHAOBIAOSJ.D_CAOZUORQ;
            storedParams[28].Value = QS_CB_CHAOBIAOSJ.S_YONGTU;
            storedParams[29].Value = QS_CB_CHAOBIAOSJ.N_SHUIJIA;
            storedParams[30].Value = QS_CB_CHAOBIAOSJ.I_SHUILIANGDL;
            storedParams[31].Value = QS_CB_CHAOBIAOSJ.I_JIHUASLDL;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_CB_CHAOBIAOSJ.ID = Convert.ToInt32(storedParams[32].Value);
            return result;
        }

        private bool UpdateQS_CB_CHAOBIAOSJ(QS_CB_CHAOBIAOSJ QS_CB_CHAOBIAOSJ, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_CB_CHAOBIAOSJ";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_CB_CHAOBIAOSJ.S_SHUIBIAOBH;
            storedParams[1].Value = QS_CB_CHAOBIAOSJ.I_CHAOBIAOZT;
            storedParams[2].Value = QS_CB_CHAOBIAOSJ.I_Y;
            storedParams[3].Value = QS_CB_CHAOBIAOSJ.I_M;
            storedParams[4].Value = QS_CB_CHAOBIAOSJ.I_BENYUECM;
            storedParams[5].Value = QS_CB_CHAOBIAOSJ.I_BENYUESL;
            storedParams[6].Value = QS_CB_CHAOBIAOSJ.I_JIHUASL;
            storedParams[7].Value = QS_CB_CHAOBIAOSJ.N_BILV;
            storedParams[8].Value = QS_CB_CHAOBIAOSJ.I_JLZT;
            storedParams[9].Value = QS_CB_CHAOBIAOSJ.S_YONGHUH;
            storedParams[10].Value = QS_CB_CHAOBIAOSJ.S_JINGBH;
            storedParams[11].Value = QS_CB_CHAOBIAOSJ.S_BUMENBH;
            storedParams[12].Value = QS_CB_CHAOBIAOSJ.S_QUSHUIYTBH;
            storedParams[13].Value = QS_CB_CHAOBIAOSJ.S_HANGYEBH;
            storedParams[14].Value = QS_CB_CHAOBIAOSJ.S_XINGZHENGQBH;
            storedParams[15].Value = QS_CB_CHAOBIAOSJ.S_LIUYUBH;
            storedParams[16].Value = QS_CB_CHAOBIAOSJ.S_HUANXIANBJ;
            storedParams[17].Value = QS_CB_CHAOBIAOSJ.I_CENG;
            storedParams[18].Value = QS_CB_CHAOBIAOSJ.S_XUKEZBH;
            storedParams[19].Value = QS_CB_CHAOBIAOSJ.S_JINGLEIXBH;
            storedParams[20].Value = QS_CB_CHAOBIAOSJ.S_JINGBIAOSBH;
            storedParams[21].Value = QS_CB_CHAOBIAOSJ.S_JINGZHUANGTBH;
            storedParams[22].Value = QS_CB_CHAOBIAOSJ.S_CEHAO;
            storedParams[23].Value = QS_CB_CHAOBIAOSJ.S_SHUILIANGLB;
            storedParams[24].Value = QS_CB_CHAOBIAOSJ.S_TIANJIAR;
            storedParams[25].Value = QS_CB_CHAOBIAOSJ.D_TIANJIARQ;
            storedParams[26].Value = QS_CB_CHAOBIAOSJ.S_CAOZUOR;
            storedParams[27].Value = QS_CB_CHAOBIAOSJ.D_CAOZUORQ;
            storedParams[28].Value = QS_CB_CHAOBIAOSJ.S_YONGTU;
            storedParams[29].Value = QS_CB_CHAOBIAOSJ.N_SHUIJIA;
            storedParams[30].Value = QS_CB_CHAOBIAOSJ.I_SHUILIANGDL;
            storedParams[31].Value = QS_CB_CHAOBIAOSJ.I_JIHUASLDL;
            storedParams[32].Value = QS_CB_CHAOBIAOSJ.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_CB_CHAOBIAOSJ PopulateQS_CB_CHAOBIAOSJ(IDataReader dr)
        {
            var QS_CB_CHAOBIAOSJ = new QS_CB_CHAOBIAOSJ();
            QS_CB_CHAOBIAOSJ.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_CB_CHAOBIAOSJ.S_SHUIBIAOBH = dr["S_SHUIBIAOBH"] == DBNull.Value ? null : (string) dr["S_SHUIBIAOBH"];
            QS_CB_CHAOBIAOSJ.I_CHAOBIAOZT = dr["I_CHAOBIAOZT"] == DBNull.Value ? null : (decimal?) dr["I_CHAOBIAOZT"];
            QS_CB_CHAOBIAOSJ.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            QS_CB_CHAOBIAOSJ.I_M = dr["I_M"] == DBNull.Value ? null : (decimal?) dr["I_M"];
            QS_CB_CHAOBIAOSJ.I_BENYUECM = dr["I_BENYUECM"] == DBNull.Value ? null : (decimal?) dr["I_BENYUECM"];
            QS_CB_CHAOBIAOSJ.I_BENYUESL = dr["I_BENYUESL"] == DBNull.Value ? null : (decimal?) dr["I_BENYUESL"];
            QS_CB_CHAOBIAOSJ.I_JIHUASL = dr["I_JIHUASL"] == DBNull.Value ? null : (decimal?) dr["I_JIHUASL"];
            QS_CB_CHAOBIAOSJ.N_BILV = dr["N_BILV"] == DBNull.Value ? null : (decimal?) dr["N_BILV"];
            QS_CB_CHAOBIAOSJ.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_CB_CHAOBIAOSJ.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            QS_CB_CHAOBIAOSJ.S_JINGBH = dr["S_JINGBH"] == DBNull.Value ? null : (string) dr["S_JINGBH"];
            QS_CB_CHAOBIAOSJ.S_BUMENBH = dr["S_BUMENBH"] == DBNull.Value ? null : (string) dr["S_BUMENBH"];
            QS_CB_CHAOBIAOSJ.S_QUSHUIYTBH = dr["S_QUSHUIYTBH"] == DBNull.Value ? null : (string) dr["S_QUSHUIYTBH"];
            QS_CB_CHAOBIAOSJ.S_HANGYEBH = dr["S_HANGYEBH"] == DBNull.Value ? null : (string) dr["S_HANGYEBH"];
            QS_CB_CHAOBIAOSJ.S_XINGZHENGQBH =
                dr["S_XINGZHENGQBH"] == DBNull.Value ? null : (string) dr["S_XINGZHENGQBH"];
            QS_CB_CHAOBIAOSJ.S_LIUYUBH = dr["S_LIUYUBH"] == DBNull.Value ? null : (string) dr["S_LIUYUBH"];
            QS_CB_CHAOBIAOSJ.S_HUANXIANBJ = dr["S_HUANXIANBJ"] == DBNull.Value ? null : (string) dr["S_HUANXIANBJ"];
            QS_CB_CHAOBIAOSJ.I_CENG = dr["I_CENG"] == DBNull.Value ? null : (decimal?) dr["I_CENG"];
            QS_CB_CHAOBIAOSJ.S_XUKEZBH = dr["S_XUKEZBH"] == DBNull.Value ? null : (string) dr["S_XUKEZBH"];
            QS_CB_CHAOBIAOSJ.S_JINGLEIXBH = dr["S_JINGLEIXBH"] == DBNull.Value ? null : (string) dr["S_JINGLEIXBH"];
            QS_CB_CHAOBIAOSJ.S_JINGBIAOSBH = dr["S_JINGBIAOSBH"] == DBNull.Value ? null : (string) dr["S_JINGBIAOSBH"];
            QS_CB_CHAOBIAOSJ.S_JINGZHUANGTBH =
                dr["S_JINGZHUANGTBH"] == DBNull.Value ? null : (string) dr["S_JINGZHUANGTBH"];
            QS_CB_CHAOBIAOSJ.S_CEHAO = dr["S_CEHAO"] == DBNull.Value ? null : (string) dr["S_CEHAO"];
            QS_CB_CHAOBIAOSJ.S_SHUILIANGLB = dr["S_SHUILIANGLB"] == DBNull.Value ? null : (string) dr["S_SHUILIANGLB"];
            QS_CB_CHAOBIAOSJ.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string) dr["S_TIANJIAR"];
            QS_CB_CHAOBIAOSJ.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?) dr["D_TIANJIARQ"];
            QS_CB_CHAOBIAOSJ.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_CB_CHAOBIAOSJ.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            QS_CB_CHAOBIAOSJ.S_YONGTU = dr["S_YONGTU"] == DBNull.Value ? null : (string) dr["S_YONGTU"];
            QS_CB_CHAOBIAOSJ.N_SHUIJIA = dr["N_SHUIJIA"] == DBNull.Value ? null : (decimal?) dr["N_SHUIJIA"];
            QS_CB_CHAOBIAOSJ.I_SHUILIANGDL =
                dr["I_SHUILIANGDL"] == DBNull.Value ? null : (decimal?) dr["I_SHUILIANGDL"];
            QS_CB_CHAOBIAOSJ.I_JIHUASLDL = dr["I_JIHUASLDL"] == DBNull.Value ? null : (decimal?) dr["I_JIHUASLDL"];
            return QS_CB_CHAOBIAOSJ;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion